<div class="boletas index">
<h2><?php __('Boletas');?></h2>

<?php

if(!empty($boletas)):

?>
<p>
	

<?php
echo $paginator->counter(array(
'format' => __('P&aacute;gina %page% de %pages%, mostrando %current% registros de %count% total, inicia en %start%, termina en %end%', true)
));
?></p>

<div class="paging">
	<?php echo $paginator->prev(__('previous', true), array('escape' => false), null, array('escape' => false, 'class'=>'rows disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('next', true), array('escape' => false), null, array('escape' => false, 'class'=>'disabled rows'));?>
</div>

<div class="export">
	<?php
	
		echo $html->link(
							__('EXPORT_TO_EXCEL', true),
							'xls',
							array(
								'escape'	=> false,
								'class'		=> 'exportbutton'
							)			
						);
	?>
</div>

<table cellpadding="0" cellspacing="0">
<tr>

	<th><?php echo $paginator->sort(__('Cedula ', true), 'Boleta.cedula');?></th>
	<th style="width: 250px;">
		<?php echo $paginator->sort(__('Nombre', true), 'nombre', array('escape' => false));?>
	<br>
	<?php echo $paginator->sort(__('Apellido1', true), 'apellido1');?>
	<br>
	<?php echo $paginator->sort(__('Apellido2', true), 'apellido2');?></th>

	<th><?php echo $paginator->sort(__('Cantone', true), 'cantone_id');?></th>
	<th><?php echo $paginator->sort(__('Distrito', true), 'distrito_id');?></th>

	<th><?php echo $paginator->sort(__('Trabaja', true), 'trabaja');?></th>

	<th><?php echo $paginator->sort(__('Procedencia ', true), 'procedencia');?></th>
	<th><?php echo $paginator->sort(__('Egreso ', true), 'egreso');?></th>
	<th><?php echo $paginator->sort(__('Adecuacion ', true), 'adecuacion');?></th>

	<th><?php echo $paginator->sort(__('Modo', true), 'modo_id');?></th>
	<th class="actions"><?php __('Actions');?></th>
</tr>
<?php

$i = 0;
foreach ($boletas as $boleta):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>

		<td>
			<?php echo $html->link($boleta['Boleta']['cedula'], array('action'=>'view', $boleta['Boleta']['id'])); ?>			
		</td>
		<td>
			<?php echo $boleta['Boleta']['nombre']. ' ' .$boleta['Boleta']['apellido1']. ' ' .$boleta['Boleta']['apellido2']; ?>
		</td>

		<td>
			<?php echo $boleta['Cantone']['nombre'];//
			//$html->link(, array('controller'=> 'cantones', 'action'=>'view', $boleta['Cantone']['id'])); 
			?>
		</td>
		<td>
			<?php echo $boleta['Distrito']['nombre'];
			//$html->link(, array('controller'=> 'distritos', 'action'=>'view', $boleta['Distrito']['id'])); 
			?>
		</td>
		<td>
			<?php echo ife($boleta['Boleta']['trabaja'],__('SI', true),__('NO', true)); ?>
		</td>
		<td>
			<?php echo $boleta['Boleta']['procedencia']; ?>
		</td>
		<td>
			<?php echo $boleta['Boleta']['egreso']; ?>
		</td>
		<td>
			<?php echo ife($boleta['Boleta']['adecuacion'],__('SI', true),__('NO', true)); ?>
		</td>
		<td>
			<?php 
			
			echo $boleta['Modo']['nombre'];
			 
			?>
		</td>
		<td class="actions">			
			<?php echo ' ' .$html->link(__('Edit', true), array('action'=>'edit', $boleta['Boleta']['id']), array('escape' => false)); ?>
			<?php echo ' ' .$html->link(__('Delete', true), array('action'=>'delete', $boleta['Boleta']['id']), array('escape' => false), sprintf(__('Are you sure you want to delete # %s?', true), $boleta['Boleta']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>

<div class="paging">
	<?php echo $paginator->prev(__('previous', true), array('escape' => false), null, array('escape' => false, 'class'=>'rows disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('next', true), array('escape' => false), null, array('escape' => false, 'class'=>'disabled rows'));?>
</div>
<?php

else:

	echo '<div class="warning">' . __('BOLETAS_NOT_FOUND', true) . '</div>';

endif;

?>

</div>